package com.wwl.cms.utils.designModeTest.builder;

/**
 * @author wwl
 * @version 1.0
 * @date 2021/9/5 23:15
 * @description:
 */
public class HouseDirector {
    HouseBuilder houseBuilder = null;
    //构造器传入houseBuilder
    public HouseDirector(HouseBuilder houseBuilder){
        this.houseBuilder=houseBuilder;
    }

    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    public House constructHouse(){
        houseBuilder.buildBasic();
        houseBuilder.buildWalls();
        houseBuilder.roofed();
        return houseBuilder.buildHouse();
    }
}
